package ran.judge.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import ran.api.domain.dto.JudgeSubmitDTO;
import ran.api.domain.vo.UserQuestionResultVO;
import ran.entity.Result;
import ran.judge.service.IJudgeService;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ran
 * Date: 2025-11-22
 * Time: 17:35
 */
@RestController
@RequestMapping("/judge")
public class JudgeController {

    @Autowired
    private IJudgeService judgeService;

    @PostMapping("/doJudgeJavaCode")
    Result<UserQuestionResultVO> doJudgeJavaCode(@RequestBody JudgeSubmitDTO judgeSubmitDTO) {
        return Result.ok(judgeService.doJudgeJavaCode(judgeSubmitDTO));
    }
}
